package com.abvnet.project.water.project.service;

import com.abvnet.common.utils.text.Convert;
import com.abvnet.project.water.project.domain.ProjectTest;
import com.abvnet.project.water.project.mapper.ProjectTestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 项目小试 服务层实现
 * 
 * @author duj
 * @date 2019-08-23
 */
@Service
public class ProjectTestServiceImpl implements IProjectTestService {
	@Autowired
	private ProjectTestMapper projectTestMapper;

	/**
     * 查询项目小试信息
     * 
     * @param testId 项目小试ID
     * @return 项目小试信息
     */
    @Override
	public ProjectTest selectProjectTestById(Long testId) {
	    return projectTestMapper.selectProjectTestById(testId);
	}

    @Override
    public ProjectTest selectProjectTestByProjectId(Long projectId) {
        return projectTestMapper.selectProjectTestByProjectId(projectId);
    }

    /**
     * 查询项目小试列表
     * 
     * @param projectTest 项目小试信息
     * @return 项目小试集合
     */
	@Override
	public List<ProjectTest> selectProjectTestList(ProjectTest projectTest) {
	    return projectTestMapper.selectProjectTestList(projectTest);
	}
	
    /**
     * 新增项目小试
     * 
     * @param projectTest 项目小试信息
     * @return 结果
     */
	@Override
	public int insertProjectTest(ProjectTest projectTest) {
	    return projectTestMapper.insertProjectTest(projectTest);
	}
	
	/**
     * 修改项目小试
     * 
     * @param projectTest 项目小试信息
     * @return 结果
     */
	@Override
	public int updateProjectTest(ProjectTest projectTest) {
	    return projectTestMapper.updateProjectTest(projectTest);
	}

	/**
     * 删除项目小试对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteProjectTestByIds(String ids) {
		return projectTestMapper.deleteProjectTestByIds(Convert.toStrArray(ids));
	}
	
}